﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using QLNS_BLL;
using QLNS_Public;

namespace QLNS_GiaoDien
{
    public partial class uc_TimKiemNhanVien : DevExpress.XtraEditors.XtraUserControl
    {
        public uc_TimKiemNhanVien()
        {
            InitializeComponent();
        }

        private void btn_Huy_Click(object sender, EventArgs e)
        {
            txt_HoTen.ResetText();
            txt_MaNhanVien.ResetText();
        }
        TimKiem_BLL tk = new TimKiem_BLL();
        NhanVien_Public nv = new NhanVien_Public();
        private void txt_MaNhanVien_TextChanged(object sender, EventArgs e)
        {
            
            nv.MaNhanVien = int.Parse(txt_MaNhanVien.Text);
            gridControl1.DataSource = tk.TimKiem_MaNhanVien(nv);
        }

        private void txt_HoTen_TextChanged(object sender, EventArgs e)
        {
            nv.HoTen = txt_HoTen.Text;
            gridControl1.DataSource = tk.TimKiem_TenNhanVien(nv);
        }

        private void txt_MaNhanVien_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!Char.IsControl(e.KeyChar) && !Char.IsDigit(e.KeyChar))
                e.Handled = true;
        }
    }
}
